Skip to content

Modernize data tutorial to torchvision v2 API#3863

Open
omkar-334 wants to merge 1 commit intopytorch:mainfrom
omkar-334:fix/3852-data-tutorial-v2
Open

Modernize data tutorial to torchvision v2 API#3863
omkar-334 wants to merge 1 commit intopytorch:mainfrom
omkar-334:fix/3852-data-tutorial-v2

Conversation

@omkar-334
Copy link
Copy Markdown

Fixes ##3852

Description

Replace deprecated ToTensor() with v2.Compose([v2.ToImage(), v2.ToDtype(torch.float32, scale=True)]) in both the training and test FashionMNIST splits, and switch the import to the v2 namespace.

Checklist

  • The issue that is being fixed is referred in the description (see above "Fixes #ISSUE_NUMBER")
  • Only one issue is addressed in this pull request
  • Labels from the issue that this PR is fixing are added to this pull request
  • No unnecessary issues are included into this pull request.

@pytorch-bot
Copy link
Copy Markdown

pytorch-bot Bot commented May 5, 2026

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/tutorials/3863

Note: Links to docs will display an error until the docs builds have been completed.

✅ No Failures

As of commit ed450b4 with merge base 5efb99a (image):
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@meta-cla meta-cla Bot added the cla signed label May 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant